<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>组建通信-props的驼峰标识</title>
</head>
<body>
<div id="app">
  <cpn :child-my-message='message' :child-user-info='userInfo'></cpn>
</div>

<template id="template-cpn">
  <div>
    <h2>{{childMyMessage}}</h2>
    <h2>{{childUserInfo}}</h2>
  </div>
</template>
<script src="../js/vue.js"></script>
<script>

  const cpn = {
    template: '#template-cpn',
    props: {
      childMyMessage: {
        type: String,
        default: ''
      },
      childUserInfo: {
        type: Object,
        default() {
          return {name: "张三", age: 20, height: 185}
        }
      }
    }
  }

  const app = new Vue({
    el: '#app',
    data: {
      message: '请问你是谁',
      userInfo: {
        name: 'why',
        age: 18,
        height: 1.80
      }
    },
    components: {
      cpn
    }
  });
</script>
</body>
</html>
